package com.guapi.dao;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.util.Objects;

@Data
@TableName("ip")
public class IpRecord {
    @TableId(type = IdType.AUTO)
    private Integer id;

    private String ip;

    @TableField("in_time")
    private Long inTime = System.currentTimeMillis();


    @TableField("create_by")
    private String createBy = "0";

    @TableField("create_date")
    @OrderBy(asc = true)
    private String createDate;

    private Integer count;

    @TableField(exist = false)
    private boolean status = true;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        IpRecord ipRecord = (IpRecord) o;
        return Objects.equals(ip, ipRecord.ip);
    }

    @Override
    public int hashCode() {
        return Objects.hash(ip);
    }
}
